<!-- 设置定时器模态框（Modal） -->
<div class="modal fade" id="workModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×
                </button>
                <h4 class="modal-title" id="myModalLabel">
                    设置定时器
                </h4>
            </div>
            <form role="form" action="/site/set-work-model?deviceId=<?= $_GET['deviceId'] ?>" method="post"
                  id="workForm">
                <div class="modal-body">
                    <div class="form-group">
                        <label for="name">请选择工作模式</label>
                        <select class="form-control" name="val">
                            <?php
                            $config = $deviceInfo['config']['workModel'];
                            ?>
                            <?php foreach ($config as $key => $val) : ?>
                                <option value="<?= $key ?>" <?php if ($key == $deviceInfo['workData']['model']) {
                                    echo 'selected';
                                } ?>>
                                <?= $val ?>
                                </option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <button type="button" class="btn btn-primary submit-modal">
                        提交更改
                    </button>
                </div>
            </form>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

